import { Children, useState } from 'react'
import './App.css'
import Home from './page/Home'//wj
import Login from './page/Login'//yyf
import ReserveManage from './page/ReserveManage'//wj
import PayManage from './page/PayManage'//yyf
import ClientManage from './page/ClientManage'//wcc
import System from './page/System'//yf=yf
import RoomManage from './page/RoomManage'//zzq
import FinanceManage from './page/Finance'//xzx
import AddClient from './components/client/add'//wcc
import Addroom from './components/room/add'//zzq
import Addreserve from './components/reserve/add'//wj
import Addpay from './components/pay/add'//ckz
import Addsystem from './components/users/add'//yyf
import Addfinance from './components/finance/add'//xzx
import Welcome from './page/welcome'//wj

import {
  BrowserRouter as Router,
  useRoutes
} from 'react-router-dom'
import Register from './page/Register'


function PrivateRouter() {
  return useRoutes([
    {
      path: '/',
      element: <Login />
    },
    {
      path: '/Register',
      element: <Register />
    },
    {
      path: '/home',
      element: <Home />,
      children: [
        {
          path: '/home/welcome',
          element: <Welcome />,
        },
        { path: '/home/reserve', element: <ReserveManage /> },
        { path: '/home/reserve/add', element: <Addreserve /> },
        { path: '/home/pay', element: <PayManage /> },
        { path: '/home/pay/add', element: <Addpay /> },
        { path: '/home/client', element: <ClientManage /> },
        { path: '/home/system', element: <System /> },
        { path: '/home/users/add', element: <Addsystem /> },
        { path: '/home/room', element: <RoomManage /> },
        { path: '/home/room/add', element: <Addroom /> },
        { path: '/home/finance', element: <FinanceManage /> },
        { path: '/home/finance/add', element: <Addfinance /> },
        { path: '/home/client/add', element: <AddClient /> }
      ]
    }
  ]);
}

function App() {
  return (
    <Router>
      <PrivateRouter />
    </Router>
  );
}

export default App;